package SecondeStage.IO.In_OutputStreamReader_Writer;

import java.io.*;

public class OutputStreamWriter_ {
    public static void main(String[] args) throws IOException {
        // 使用OutputStreamWriter解决转换中文乱码问题
        // 将字节流FileOutputStream 转换为字符流 OutputStreamWriter,指定编码 gbk/utf-8
        String filePath ="D:\\Java\\JavaProject\\ok.txt";
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(filePath),"UTF-8");

        osw.write("你好韩顺平");

        osw.close();
    }
}
